<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>积分平台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="__INDEX__/mui/css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/newComNotice.css"/>
		<script src="__INDEX__/js/lib/font.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
	    <header class="mui-bar mui-bar-nav">
	        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			{if $type=='com'}
	        <h1 class="mui-title">新建公司公告</h1>
			{else}
			<h1 class="mui-title">新建部门公告</h1>
			{/if}
	    </header>
	    <div class="mui-content">
			<form method="post" enctype="multipart/form-data" id="test">
			<div class="modular">
				<div class="mui-input-row">
			        <label>公告标题：</label>
			    	<input type="text" class="mui-input-clear" name="title" placeholder="请填写公告标题">
			    	<span class="mui-icon mui-icon-arrowright"></span>
				</div>
			</div>
				<input type="text" name="type" value="{$type}" style="display: none">
			<div class="modular">
				<textarea name="contents" class="textCont" placeholder="请填写您的公告内容(500字以内)" ></textarea>
				<div class="cont-bottom">
					<div class="addImg mui-pull-left">
						<!--<span class="defaultImg" >-->
							<!--<label for='test1'>-->
								<!--<img src="__INDEX__/images/addImg.png"/>-->
							<!--</label>-->
							<!--<input class="xiangce" name="picture[]" id="test1"  type="file" multiple>-->
						<!--</span>-->
						<input type="file" id="test1" name="picture[]" multiple>
					</div>
					<p class="mui-pull-right">最多添加3张图片</p>
				</div>
			</div>
			<div class="modular">
				<div class="mui-input-row">
			        <label>发布日期：</label>
			    	<input type="text" id="dateTime" name="creat_time" class="mui-input-clear" disabled="disabled" value="2018-06-20" />
				</div>
			</div>
			</form>
	    </div>
	    <button class="btn mui-btn mui-btn-block" id="fasong" data="{$type}">确定发送</button>
		<script src="__INDEX__/js/lib/zepto.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.view.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/layer_mobile/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/newComNotice.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/jquery.3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/maowenke.js" type="text/javascript" charset="utf-8"></script>
	<script>
		$("#fasong").click(function () {
		    //console.log($("#test1").val());
			ajax($("#test"),"{:url('add/notice')}",function (data) {
			    console.log(data);
				if(data.code==200){
				    mui.alert(data.msg);
				    setTimeout(function () {
                        window.location.href = "{:url('index/noticelist')}?name="+"{$type}";
                    },1000);
				}else{
				    mui.alert(data.msg);
				}
            })
        })
	</script>
	</body>
</html>
